/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ideastec.mipyme.presentation.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Clase encargada de cargar el contexto Spring
 *
 * @author Diego Rafael Graf
 */
public class SpringContext {
    
    private static SpringContext instance;
    
    private ApplicationContext context;
    
    //Cargamos el contexto de spring
    private SpringContext (){
        context = new ClassPathXmlApplicationContext(new String[]{"spring-config.xml"});
    }
    
    public static SpringContext getInstance(){
        if (instance == null){
            instance = new SpringContext();
        }
        return instance;
    }
    
    public ApplicationContext getContext(){
        return context;
    }
}
